Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[r] Provide reference to libtiledbsoma source via soft-link #1372

Merged
merged 4 commits into from
May 13, 2023

Conversation

eddelbuettel
Copy link
Contributor

Issue and/or context:

The R package in apis/r needs the libtiledbsoma library. Current package practice, when a build is required as no system installation is found is to bring the source in 'externally'. Using a soft-link back to the library source was considered at some point but discarded as it seemed unclear how git, R (esp when build the 'release' tarball) and different file systems would react.

It turns out that those fears were unfounded. Using a soft-link (even to a directory) works just fine in recent git, and R CMD build transparently follows the link and includes the sources as a backup. This also works at r-universe per initial tests.

This is an improved approach as it ties the usage of the library closer to the provision and minimises risk of slippage.

Changes:

As before, when a system library is seen no build is needed. If a build is needed, it is made with the source which are either included in the tar.gz or accessible when the repo is checked (as in the case of CI at GH Actions). The download step is skipped which allowed for a minor refactoring of the configure script which is again the only place from which
src/Makevars is constructed. An extra wrinkle of testing for an 'out of $PATH' cmake was added as needed at CRAN in case we ever upload (and/or this setup serves as model for other uses).

Notes for Reviewer:

SC 28874

@shortcut-integration
Copy link

@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -11.63 ⚠️

Comparison is base (1fbe2f6) 65.11% compared to head (d57d68a) 53.49%.

❗ Current head d57d68a differs from pull request most recent head 6101892. Consider uploading reports for the commit 6101892 to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1372       +/-   ##
===========================================
- Coverage   65.11%   53.49%   -11.63%     
===========================================
  Files          98       68       -30     
  Lines        7798     5382     -2416     
===========================================
- Hits         5078     2879     -2199     
+ Misses       2720     2503      -217     
Flag Coverage Δ
python ?
r 53.49% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 44 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@johnkerl johnkerl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- very elegant solution!

I left one comment about our dependency-updater script

Let me try this locally on my Mac laptop (outside of CI) before approving

Thanks again!

#!/usr/bin/env Rscript

## version pinning info
tiledb_core_version <- "2.15.2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to minimize keystroking on future dependency-upgrade PRs, @gspowley wrote a very nice scripts/update-tiledb-version.py:

it looks like that script might not update this current script as-is -- ?

updating that script to handle this file might be done on this PR, or on a follow-up PR

Copy link
Contributor Author

@eddelbuettel eddelbuettel May 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered about that too but I thought the above was better because we only to change once for version and sha1 rather than three times (with largely redundant long URLs):

if (isMac) {
if (isX86) {
url <- "https://github.com/TileDB-Inc/TileDB/releases/download/2.15.2/tiledb-macos-x86_64-2.15.2-90f30eb.tar.gz"
macosver <- "-mmacosx-version-min=10.14"
} else {
url <- "https://github.com/TileDB-Inc/TileDB/releases/download/2.15.2/tiledb-macos-arm64-2.15.2-90f30eb.tar.gz"
}
} else if (isLinux) {
url <- "https://github.com/TileDB-Inc/TileDB/releases/download/2.15.2/tiledb-linux-x86_64-2.15.2-90f30eb.tar.gz"
} else {
stop("Unsupported platform for downloading artifacts. Please have TileDB Core installed locally.")
}

Easy enough to revert if that is what we prefer. In tiledb-r I actually update two-line text 'key: value' text file that is then read (via a DCF reader R has in base so no need to worry about jaml or json...):

https://github.com/TileDB-Inc/TileDB-R/blob/870f9343bd4fab056e8e46ee83b23acfb47b423d/tools/tiledbVersion.txt#L1-L2

@@ -0,0 +1 @@
../../../libtiledbsoma/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apis/r/configure Outdated Show resolved Hide resolved
@eddelbuettel
Copy link
Contributor Author

Let me try this locally on my Mac laptop (outside of CI) before approving

Let me know tomorrow or Sunday how it went. My score is pretty bright green at this point:

  • linux w/ system lib (locally)
  • linux w/o system lib in container (locally)
  • linux w/o system lib at CI
  • linux w/o system lib at r-universe
  • linux w/o system via via remotes::github_install() in container (locally)
  • macos w/o system lib at CI
  • macos w/o system lib at r-universe

Copy link
Member

@johnkerl johnkerl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on personal non-CI mac which is the last bit of ☘️ IMO :D

@eddelbuettel eddelbuettel merged commit 5da0a3a into main May 13, 2023
@eddelbuettel eddelbuettel deleted the de/sc-28874/libtiledbsoma_softlink branch May 13, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants